package csc.daonjpa.java.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Entity class for Account table. This is a simple POJO class with annotations
 * to define mapping with DB table
 * 
 * @author nvu3
 *
 */
@Entity(name = "transaction")
public class Transaction implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "transactionID")
	private int transactionID;

	@Column(name = "targetBank")
	private String targetBank;

	@Column(name = "targetBranch")
	private String targetBranch;

	@Column(name = "amountNumber")
	private int amountNumber;

	@Column(name = "date")
	private String date;

	@Column(name = "sourceAccount")
	private String sourceAccount;

	@Column(name = "targetAccount")
	private String targetAccount;

	public Transaction() {

	}

	public int getTransactionID() {
		return transactionID;
	}

	public void setTransactionID(int transactionID) {
		this.transactionID = transactionID;
	}

	public String getTargetBank() {
		return targetBank;
	}

	public void setTargetBank(String targetBank) {
		this.targetBank = targetBank;
	}

	public String getTargetBranch() {
		return targetBranch;
	}

	public void setTargetBranch(String targetBranch) {
		this.targetBranch = targetBranch;
	}

	public int getAmountNumber() {
		return amountNumber;
	}

	public void setAmountNumber(int amountNumber) {
		this.amountNumber = amountNumber;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public String getSourceAccount() {
		return sourceAccount;
	}

	public void setSourceAccount(String sourceAccount) {
		this.sourceAccount = sourceAccount;
	}

	public String getTargetAccount() {
		return targetAccount;
	}

	public void setTargetAccount(String targetAccount) {
		this.targetAccount = targetAccount;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Transaction(int transactionID, String targetBank,
			String targetBranch, int amountNumber, String date,
			String sourceAccount, String targetAccount) {
		super();
		this.transactionID = transactionID;
		this.targetBank = targetBank;
		this.targetBranch = targetBranch;
		this.amountNumber = amountNumber;
		this.date = date;
		this.sourceAccount = sourceAccount;
		this.targetAccount = targetAccount;
	}

	@Override
	public String toString() {
		return "Transaction [transactionID=" + transactionID + ", targetBank="
				+ targetBank + ", targetBranch=" + targetBranch
				+ ", amountNumber=" + amountNumber + ", date=" + date
				+ ", sourceAccount=" + sourceAccount + ", targetAccount="
				+ targetAccount + "]";
	}

}